package com.example.plugina;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.shadowcore.constants.GlobalConstants;

/*
    宿主 提供 上下文 和 生命周期
 */
public class MainActivity extends ShadowContext {

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tv_hello).setOnClickListener(v -> {
            Toast.makeText(mActivity, savedInstanceState.getString(GlobalConstants.KEY_ACCOUNT),Toast.LENGTH_LONG).show();
           startActivity( new Intent(mActivity,SecondActivity.class));
        });
    }
}